<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/static/common/taglibs.jsp" %>
<script type="text/javascript" src="${ctx }/static/jui/area.js"></script>
<script>
    $(document).ready(function() {
               //setup();
                var type = $("#type");
                var userLevel = $("#userLevel");
                type.change( function() {
                    if(type.val()==2){
                        $.post("${ctx}${baseMapping}/proxy",
                                function(data){
                                    userLevel.after(data);
                                });
                    }else{
                        $('#parent').remove();
                    }
                });
            }
    );
</script>
<div class="page">
    <div class="pageContent">

        <form method="post" action="${ctx}${baseMapping }/save"
              class="pageForm required-validate"
              onsubmit="return validateCallback(this, dialogAjaxDone)">
            <input type="hidden" name="id" value="${user.id}"/>

            <div class="pageFormContent" layoutH="68">

                <div class="unit">
                    <label>用户名：</label>
                    <input type="text" id="name" name="loginName" size="15"
                           class="required" value="${user.loginName}"/>
                </div>

                <div class="unit">
                    <label>密码:</label>
                    <input type="text" id="password" name="password" size="15"
                           class="required" value="${user.sourcePassword}"/>
                </div>
				<c:if test="${cUser.type==0 }">
	                <div class="unit" id="userLevel">
	                    <label>会员级别:</label>
	                    <select name="type" id="type">
	                        <option value="1">代理商</option>
	                        <option value="2">代理商直属零售</option>
	                        <option value="3">厂商直属零售</option>
	                    </select>
	                </div>
				</c:if>
                <%-- <div class="unit">
                    <label>省市县:</label>
                    <table>
                        <tr>
                            <td><select id="province" runat="server" name="shopAddress.prov"></select></td>
                        </tr>
                        <tr>
                            <td><select id="city" runat="server" name="shopAddress.city"></select></td>
                        </tr>
                        <tr>
                            <td><select id="county" runat="server" name="shopAddress.county"></select></td>
                        </tr>
                    </table>
                </div>

                <div class="unit">
                    <label>街道:</label>
                    <input type="text" name="shopAddress.address" value="${user.shopAddress.address}" size="15">
                </div>

                <div class="unit">
                    <label>邮编:</label>
                    <input type="text" name="shopAddress.zipCode" value="${user.shopAddress.zipCode}" size="15">
                </div>

                <div class="unit">
                    <label>联系电话:</label>
                    <input type="text" name="shopAddress.cellphone" value="${user.shopAddress.cellphone}" size="15">
                </div> --%>

            </div>
            <div class="formBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit" id="btn" class="btn">提交</button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="button">
                            <div class="buttonContent">
                                <button type="button" class="close">取消</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </form>
    </div>
</div>

